using System;
using System.Data;
using System.Collections;
using BeeldBank.Business;

namespace BeeldBank.Business.Collection.Base
{
	/// <summary>
	/// Provides database independant methods for MediaObject.
	/// </summary>
	public class MediaObjectCollectionBase : BusinessCollection
	{
		public MediaObjectCollectionBase(Luw luw) : base(luw)
		{
		}

		public MediaObjectCollectionBase(Luw luw, DataRow row) : base(luw)
		{
			this.Add(_luw.NewMediaObject(row));
		}

		public MediaObjectCollectionBase(Luw luw, DataTable table) : base(luw)
		{
			foreach(DataRow row in table.Rows)
			{
				this.Add(_luw.NewMediaObject(row));
			}
		}

		public int Add(MediaObject item)
		{
			return List.Add(item);
		}
		
		public void Insert(int index, MediaObject item)
		{
			List.Insert(index, item);
		}
		
		public void Remove(MediaObject item)
		{
			List.Remove(item);
		}
		
		public bool Contains(MediaObject item)
		{
			return List.Contains(item);
		}
		
		public int IndexOf(MediaObject item)
		{
			return List.IndexOf(item);
		}
		
		public void CopyTo(MediaObject[] array, int index)
		{
			List.CopyTo(array, index);
		}
		
		public MediaObject this[int index]
		{
			get 
			{
				return (MediaObject)List[index]; 
			}
			set 
			{
				List[index] = value; 
			}
		}
	}
}
